﻿$(function()
{
});



//procedure: The database stored procedure you want to access
//args: The parameters for the stored procedure
//callback: The function you want to call after ajax success
function AJAX(procedure, args, callback)
{
	$.ajax({
		type: "POST",
		url: "../WebServices.asmx/Database",
		data: { 'procedure': procedure, 'args': args },
		//contentType: "application/xml; charset=utf-8",
		dataType: "xml",
		success: function (data)
		{
			//Call the callback function, passing it the returned data
			callback($(data).find("string").text());
		}
	});
}










//=======================================OLD SHIT=======================================================
//=======================================OLD SHIT=======================================================


//function GetProjectNames(category)
//{
//	$.ajax({
//		type: "POST",
//		url: "WebServices.asmx/GetProjectNames",
//		data: "category=" + category,
//		//contentType: "application/xml; charset=utf-8",
//		dataType: "xml",
//		success: function (msg)
//		{
//			alert(msg);
//		}
//	});
//}

//function DisplayProjectHighlights(projectID, div)
//{
//	$.ajax({
//		type: "POST",
//		url: "WebServices.asmx/GetProjectHighlights",
//		data: "projectID=" + projectId,
//		//contentType: "application/xml; charset=utf-8",
//		dataType: "xml",
//		success: function (msg)
//		{
//			alert(msg);
//			$(div).html(msg); //uhh
//		}
//	});
//}

//function DisplayProjectImage(projectID, div)
//{
//	$.ajax({
//		type: "POST",
//		url: "WebServices.asmx/GetProjectImage",
//		data: "projectID=" + projectId,
//		//contentType: "application/xml; charset=utf-8",
//		dataType: "xml",
//		success: function (msg)
//		{
//			alert(msg);
//		}
//	});
//}

//function GetProjectStatus(projectID)
//{
//	$.ajax({
//		type: "POST",
//		url: "WebServices.asmx/GetProjectStatus",
//		data: "projectID=" + projectId,
//		//contentType: "application/xml; charset=utf-8",
//		dataType: "xml",
//		success: function (msg)
//		{
//			alert(msg);
//		}
//	});
//}

//function GetProjectTitle(projectID)
//{
//	$.ajax({
//		type: "POST",
//		url: "WebServices.asmx/GetProjectTitle",
//		data: "projectID=" + projectId,
//		//contentType: "application/xml; charset=utf-8",
//		dataType: "xml",
//		success: function (msg)
//		{
//			alert(msg);
//		}
//	});
//}

//function Search(query)
//{
//	$.ajax({
//		type: "POST",
//		url: "WebServices.asmx/Search",
//		data: "query=" + query,
//		//contentType: "application/xml; charset=utf-8",
//		dataType: "xml",
//		success: function (msg)
//		{
//			alert(msg);
//		}
//	});
//}